<%@page import="java.sql.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<jsp:useBean id="databaseBean" scope="session" class="warehouse.DatabaseBean"/>    

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>仓库信息一览表</title>

<link rel="stylesheet" href="layui/css/layui.css">
<script src="layui/layui.js"></script>
</head>
<body>
	<h1 style="text-align:center">仓库信息一览表</h1>
	<table class="layui-table" lay-even>
		<thead>
		<tr>
			<th>仓库编号</th>
			<th>仓库地址</th>
			<th>操作</th>
		</tr>
		</thead>
		<%
		String sql="SELECT * FROM Warehouse;";
		ResultSet rs=databaseBean.executeQuery(sql);
		while(rs.next()){
			%>
			<tr>
				<td><%=rs.getString("warehouseNo")  %>	</td>
				<td><%=rs.getString("address")  %>		</td>
				<td>
					<a href="<%="warehouse.jsp?warehouseNo="+ rs.getString("warehouseNo")%>" 
					class="layui-btn">查看详情</a>
					
				</td>
			</tr>		
			<%
		}
		rs.close();//关闭结果集
		%>
	</table>
</body>
</html>